GL0SNAKE1 (C) Copyright, 1990, by Timothy J. Baehr. All rights reserved. For information or to register this program: Timothy J. Baehr / P.O. Box 1345 / Jamaica Plain, MA 02130 / Phone (617) 524-6569. This program will set up evenly-spaced snaking columns based on your current right margin. It differs from XyWrite's instructions in that you can specify a definite right margin for the entire type page and then specify the amount of space between columns. The width of the columns is calculated automatically. If you normally use a left margin, you will probably want to replace it with the offset marker and adjust your right margin accordingly. Otherwise, you can end up with too much space between columns. This, by the way, is a problem you'll also run into if you do snaking columns according to XyWrite's instructions. You will want to set the overall right margin for the entire block of columns before you run this program. When you run the program, you are prompted for the number of columns and for the amount of space between columns. (You can also specify these on the command line -- type RUN SNAKE1 4,3 < for instance.) Default offset is set at the offset of the surrounding text. Default column to start on is 0 (zero) -- that's the first number after SN in the set-up triangle. Editing is easiest to do in expanded mode. See the XyWrite manual for details about snaking columns. LB0cs sx01,varmsx01,is01sx05,vaofsx06,2sv07,sv40,,if(@SIZ(is00)==0)!@NOT(is40is00=>0)glstart eixs00,40,41,42,43ifpv41>6run snake1 PRNot over 6 columns, pleaseexeisx99,is41sx98,is43glGO lbstartlbLoop1How many columns (2-6)?PR to cancelsx99,rcif(is99is07==0)PROperation canceledex1eiif(pv99<2)!(pv99>6)glLoop1eilbLoop2Space between columns (0-9)?PR to cancelsx98,rcif(is98is07==0)PROperation canceledex1eiif(pv98<0)!(pv98>9)glLoop2eilbGOsx02,pv01/pv99+pv98/pv99sx02,is02ifpv020sx22,pv22+.1pv22sx22,pv22-.1glconteipv22lbcontifpv06=>pv99glendeisx06,pv06+1sx22,(pv22+pv02)glLoop3 lbend SPRDoneex lbmsgp You've set up negative space in columns!SV00,GL0 Technical notes: The program is complicated because of the mathematical formula needed to calculate column widths based on desired gutter width and overall right margin. XyWrite's xs function is used to parse the mathematical results to limit the column locations to a single digit after the decimal and to make sure that no zero follows the decimal. That's because the SN command can malfunction with column specification that includes more than one numeral after the decimal, or with a zero after the decimal. An error trap prevents you from setting up negative columns, that is, columns whose right margin would be to the left of the column beginning.